package cor;

import general.Commands;
import general.MessageHandler;
import general.MessageHandler;
import general.MessageHandler;
import general.UDPMessage;
import general.UDPMessage;
import general.UDPMessage;
import java.util.logging.Level;
import java.util.logging.Logger;


/**
 *
 * @author foliveira
 */
public class EchoHandle extends MessageHandler{

  @Override
  public boolean accept(UDPMessage message) {
    
    // para facilitar a obtnçõa de partes da mesnsagens
    this.setRequest(message.getText());
    
    if (getRequest().getCommand().contains("ECHO"))
      return true;
    else
      return false;
  }

  @Override
  public void doHandle(UDPMessage message) {
    try {
      message.reply("eco respondeu adequadamente...");
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
  
  
  
}